$env:PSNetAdapterConfig = "C:\build\PSNetAdapterConfig\1.0.0.0"
cd $env:PSNetAdapterConfig

heat dir "$($env:PSNetAdapterConfig)\PSNetAdapterConfig" -nologo -sfrag -suid -ag -srd -dir PSNetAdapterConfig -out PSNetAdapterConfig.wxs -cg PSNetAdapterConfig -dr PSNetAdapterConfig -var var.PSNetAdapterConfig

#Download Install sed
#http://gnuwin32.sourceforge.net/
set-alias -Name sed -Value "C:\Program Files (x86)\GnuWin32\bin\sed.exe"
dir *.wxs -Exclude PSNetAdapterConfigAll.wxs | foreach {sed -e "2i <?include `$(sys.CURRENTDIR)\\Config.wxi?>" -i $_.Name}
remove-item sed*

#Fix duplicate files in ISECreamBasic and OralceISE -- give unique prefix ICB and Ora
#May need to generate new guid for Product Id
([System.Guid]::NewGuid().toString()).ToUpper()

candle.exe PSNetAdapterConfigAll.wxs PSNetAdapterConfig.wxs

light.exe -ext WixUIExtension -out PSNetAdapterConfig.msi PSNetAdapterConfigAll.wixobj PSNetAdapterConfig.wixobj -b "$($env:PSNetAdapterConfig)"